/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;

/**
 * @author STORM
 */
public class Midlet extends MIDlet implements CommandListener {
    private MIDPCanvas mCanvas;
    private Command mExit = new Command("Exit", Command.EXIT, 0);
    private Command mPause = new Command("Pause", Command.SCREEN, 0);
    
    public Midlet() {
        mCanvas = new MIDPCanvas();
        mCanvas.addCommand(mExit);
        mCanvas.addCommand(mPause);
        mCanvas.setCommandListener(this);
    }

    public void startApp() {
        Display.getDisplay(this).setCurrent(mCanvas);
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Displayable d) {
        if(c==mExit) {
            destroyApp(true);
            notifyDestroyed();
        }
    }
}